<template>
  <a-modal
    class="hmodal hmodal-dark"
    v-model="show"
    v-bind="config"
    :closable="false"
    @cancel="cancel"
    :footer="null">
    <div class="dark-modal-content">
      <slot></slot>
    </div>
    <!-- <a-icon @click="cancel" class="close" type="close" /> -->
    <div class="close-dark" @click="cancel">
      <!-- <img :src="require('@/assets/Image/close-dark.png')" width="100%" alt=""> -->
    </div>
  </a-modal>
</template>
<script>
export default {
  name: 'HModalDark',
  props: {
    config: {
      default: () => {
        return {

        };
      }
    },
    hideFooter: {
      type: Boolean,
      default: false
    },
    title: {
      type: String,
      defalut: ''
    },
    okText: {
      type: String,
      defalut: '确 认'
    },
    cancelText: {
      type: String,
      defalut: '取 消'
    },
    showModal: {
      type: Boolean,
      default: false
    }
  },
  model: {
    prop: 'showModal',
    event: 'update:showModal'
  },
  data() {
    return {
      show: false
    };
  },
  watch: {
    showModal: {
      handler(val) {
        this.show = val;
      },
      immediate: true
    },
    show(val) {
      this.$emit('update:showModal', val);
    }
  },
  beforeDestroy() {
    this.show = false;
  },
  created() {

  },
  methods: {
    cancel() {
      this.show = false;
      this.$emit('cancel');
    },
    submit() {
      // this.show = false;
      this.$emit('submit');
    }
  }
};
</script>
<style lang="less">
.hmodal.hmodal-dark {
  padding: 0;
  position: relative;
  .ant-modal {
    width: 1112px !important;
    position: relative;
  }

  .close {
    position: absolute;
    right: 30px;
    top: 30px;
    font-size: 24px;
    color: #fff;
    cursor: pointer;
  }

  .ant-modal-content {
    border-radius: 20px;
    overflow: hidden;
    position: relative;
  }
  .ant-modal-body {
    padding: 0;
    padding-bottom: 44px;
  }
  .ant-modal-header {
    display: none;
  }
  .ant-modal-mask {
    background: rgba(0,0,0,0.7);
  }
  .ant-modal-content {
    background: none;
  }

  .dark-modal-content {
    // background: #ddd;
    height: 623px;
    // overflow-y: auto;
    // background: url('~@/assets/Image/dark-modal.png');
    background-size: 100% 100%;
    padding-right: 12px;
    padding: 35px 58px;
    position: relative;
    // &::-webkit-scrollbar {
    //   width: 8px;
    //   height: 1px;
    // }
    // &::-webkit-scrollbar-thumb {
    //     border-radius: 10px;
    //     background: #1F3B8A;
    //   }
    // &::-webkit-scrollbar-track {
    //   border-radius: 10px;
    //   background: #EDEDED;
    // }
  }

  .close-dark {
    width: 38px;
    margin: 0 auto;
    margin-top: 30px;
    cursor: pointer;
  }
}

</style>
